package com.example.demo.controller;


import com.example.demo.dao.GongYingDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class GongYingController {
    @Autowired
    GongYingDao gongYingDao;

    @PostMapping("/del_gongying")
    public int del_GongYing(@RequestBody Map map){
        return gongYingDao.del_gongying(map);
    }

    @PostMapping("/add_gongying")
    public int add_GongYing(@RequestBody Map map){
        return gongYingDao.add_gongying(map);
    }

    @PostMapping("/find_all_gongying")
    public List<Map> find_all_GongYing(@RequestBody Map map) throws InterruptedException {

        return gongYingDao.find_all_gongying(map);
    }
}
